{% extends 'traffic_log/base.html' %}
{% load traffic_log_extras %}

{% block title %}
Traffic Log Spots
{% endblock %}


{% block nav %}
{{ block.super }}
<br/>

<input id="refresh-button" type="button" value="Refresh time slots" />

{% endblock %}
{% block contents %}
<p/>

<table id="traffic_log">
<tr>
    <th>Time slot</th>
    <th>Spot</th>
    <th>Actions</th>
</tr>
{% for slotted_spot in slotted_spots %}

{% for spot_view in slotted_spot.iter_spots_at_constraint %}
<tr class="{% if spot_view.finished %}finished{% else %}new{% endif %}">
    <td>{% ifchanged %}<b>{{ slotted_spot.readable_slot_time }}</b>{% endifchanged %}</td>
    <td>{{ spot_view.spot.title }}</td>
    <td>
        <a class="show-text-for-reading" 
            href="{% url_to_read_spot slotted_spot spot_view.spot %}">Show text for reading</a>
    </td>
</tr>
{% endfor %}
    
{% endfor %}
</table>

{% block modal %}
<div id="modal-container"></div>
{% endblock %}

{% endblock %}
